package com.hrm.controller.cam;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.hrm.model.dto.cam.CamViewDTO;
import com.hrm.model.service.CamService;

public class CheckController implements Controller {
	private CamService camService;
	

	public void setCamService(CamService camService) {
		this.camService = camService;
	}


	@Override
	public ModelAndView handleRequest(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		ModelAndView mv = new ModelAndView();
		
		String camstate = arg0.getParameter("camstate");
		
		CamViewDTO dto = new CamViewDTO();
		
		dto.setCamstate(camstate);
		
		List<CamViewDTO> checklist = camService.getAllCam(dto);
		
		mv.addObject("checklist", checklist);
		mv.setViewName("cam2");
		
		return mv;
	}

}
